package com.cke.yang.preview.domain.model;

import com.cke.yang.preview.infra.enums.PreviewPagePathEnum;
import lombok.Getter;
import lombok.Setter;

import java.util.Collections;
import java.util.List;

/**
 * 文件预览结果封装体
 *
 * @author yuyang
 * @date 2025-11-18 00:00:00
 */
@Getter
@Setter
public class PreviewLinkWrapper {

    /**
     * 处理器Code
     */
    private String pagePath;

    /**
     * 处理消息
     */
    private String msg;

    /**
     * 文件列表
     */
    List<PreviewLink> fileList;

    public static PreviewLinkWrapper error(String msg) {
        PreviewLinkWrapper result = new PreviewLinkWrapper();
        result.setPagePath(PreviewPagePathEnum.UNKNOWN.getPath());
        result.setMsg(msg);
        result.setFileList(Collections.emptyList());
        return result;
    }

}
